import {request} from "@@/exports";

/**
 * 上传单个文件
 * @param file
 * @param options
 */
export async function fileUpload(file: any, options?: { [key: string]: any }) {
  let formData = new FormData()
  formData.append('file', file)
  return request<ResponseMessage<string>>('/file/upload', {
    method: 'POST',
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    data: formData,
    ...(options || {}),
  });
}
